package com.qiaoas.springbootmybatisbymysqlcrud.Service.Impl;

import com.qiaoas.springbootmybatisbymysqlcrud.Bean.User;
import com.qiaoas.springbootmybatisbymysqlcrud.Mapper.UserMapper;
import com.qiaoas.springbootmybatisbymysqlcrud.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("userService")
public class UserServiceImp implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public int insert(User user) {
        return this.userMapper.add(user);
    }

    @Override
    public int update(User user) {
        return this.userMapper.update(user);
    }

    @Override
    public int delete(int no) {
        return this.userMapper.delete(no);
    }

    @Override
    public User userQuery(int no) {
        return this.userMapper.getUser(no);
    }
}
